<?php 
class ComBorder
{
	/* Values That are commented out are to be used in admin only */
	
	public $Id;
	public $Type;
	//public $Width;
	//public $ImageBg;
	//public $ImageTop;
	public $ImageTopL;
	public $ImageTopR;
	public $ImageBot;
	public $ImageBotL;
	public $ImageBotR;
	//public $ImageMidL;
	//public $ImageMidR;
	//public $Active;
	
	public function ComBorder($id) 
	{ 
		if($id > 0)
		{ $this->Id = $id; }
	}
	
	public function getId() { return $this->Id;  }
	public function getType() { return $this->Type; }
	//public function getWidth() { return $this->Width; }
	//public function getImageBg() { return $this->ImageBg; }
	//public function getImageTop() { return $this->ImageTop; }
	public function getImageTopL() { return $this->ImageTopL; }
	public function getImageTopR() { return $this->ImageTopR; }
	public function getImageBot() { return $this->ImageBot; }
	public function getImageBotL() { return $this->ImageBotL; }
	public function getImageBotR() { return $this->ImageBotR; }
	//public function getImageMidL() { return $this->ImageMidL; }
	//public function getImageMidR() { return $this->ImageMidR; }
	//public function getActive() { return $this->Active; }
	
	public function setId($val) { $this->Id=$val; }
	public function setType($val) { $this->Type=$val; }
	//public function setWidth($val) { $this->Width=$val; }
	//public function setImageBg($val) { $this->ImageBg=$val; }
	//public function setImageTop($val) { $this->ImageTop=$val; }
	public function setImageTopL($val) { $this->ImageTopL=$val; }
	public function setImageTopR($val) { $this->ImageTopR=$val; }
	public function setImageBot($val) { $this->ImageBot=$val; }
	public function setImageBotL($val) { $this->ImageBotL=$val; }
	public function setImageBotR($val) { $this->ImageBotR=$val; }
	//public function setImageMidL($val) { $this->ImageMidL=$val; }
	//public function setImageMidR($val) { $this->ImageMidR=$val; }
	//public function setActive($val) { $this->Active=$val; }
	
	public function getHTML($tbt='top')
	{
		if($this->Id > 0)
		{
			$out = '';
			if($tbt == 'top')
			{
				$out = 	'<div class="rc_border">';
				$out .= 	'<div class="border_'.$this->Id.'">';
				if($this->Type > 0)
				{ 
					if($this->Type > 1)
					{
						if($this->ImageTopL != '')
						{ $out .= 			'<div class="tl_'.$this->Id.'">'; }
							if($this->ImageTopR != '')
							{ $out .= 			'<div class="tr_'.$this->Id.'">'; }
					}
					$out .= '<div class="top_'.$this->Id.'"></div>';
					if($this->Type > 1)
					{
							if($this->ImageTopR != '')
							{ $out .= 			'</div>'; }
						if($this->ImageTopL != '')
						{ $out .= 			'</div>'; }
					}
					$out .= 		'<div class="mid_l_'.$this->Id.'">';
						$out .= 		'<div class="mid_r_'.$this->Id.'">';
							$out .= 		'<div class="core_'.$this->Id.'">';
				}
			}
			else
			{
				if($this->Type > 0)
				{ 
					$out .= 				'</div>';
					$out .= 			'</div>';
					$out .= 		'</div>';
					if($this->Type > 1)
					{
						if($this->ImageBotL != '')
						{ $out .= 			'<div class="bl_'.$this->Id.'">'; }
							if($this->ImageBotR != '')
							{ $out .= 			'<div class="br_'.$this->Id.'">'; }
					}
					$out .= '<div class="bot_'.$this->Id.'"></div>';
					if($this->Type > 1)
					{
							if($this->ImageBotR != '')
							{ $out .= 			'</div>'; }
						if($this->ImageBotL != '')
						{ $out .= 			'</div>'; }
					}
				}
				$out .= 	'</div>';
				$out .= '</div>';
			}
			return $out;
		}
	}
	
	public function getBotHTML()
	{
		if($this->Id > 0)
		{
			$out = '';
			if($this->Type > 0)
			{ 
				$out .= 				'</div>';
				$out .= 			'</div>';
				$out .= 		'</div>';
				if($this->Type > 1)
				{
					if($this->ImageBotL != '')
					{ $out .= 			'<div class="bl_'.$this->Id.'">'; }
						if($this->ImageBotR != '')
						{ $out .= 			'<div class="br_'.$this->Id.'">'; }
				}
				$out .= '<div class="bot_'.$this->Id.'"></div>';
				if($this->Type > 1)
				{
						if($this->ImageBotR != '')
						{ $out .= 			'</div>'; }
					if($this->ImageBotL != '')
					{ $out .= 			'</div>'; }
				}
			}
			$out .= 	'</div>';
			$out .= '</div>';
			return $out;
		}
	}
	
	public function getTopHTML()
	{
		if($this->Id > 0)
		{
			$out = 	'<div class="rc_border">';
			$out .= 	'<div class="border_'.$this->Id.'">';
			if($this->Type > 0)
			{ 
				if($this->Type > 1)
				{
					if($this->ImageTopL != '')
					{ $out .= 			'<div class="tl_'.$this->Id.'">'; }
						if($this->ImageTopR != '')
						{ $out .= 			'<div class="tr_'.$this->Id.'">'; }
				}
				$out .= '<div class="top_'.$this->Id.'"></div>';
				if($this->Type > 1)
				{
						if($this->ImageTopR != '')
						{ $out .= 			'</div>'; }
					if($this->ImageTopL != '')
					{ $out .= 			'</div>'; }
				}
				$out .= 		'<div class="mid_l_'.$this->Id.'">';
					$out .= 		'<div class="mid_r_'.$this->Id.'">';
						$out .= 		'<div class="core_'.$this->Id.'">';
			}
			return $out;
		}
	}
}
?>